<template>
  <el-select v-model="value" filterable clearable placeholder="全部状态" @change="write" @clear="clearWrite">
    <el-option
      v-for="item in allState"
      :key="item.value"
      :label="item.label"
      :value="item.value">
    </el-option>
  </el-select>
</template>

<script>
export default {
  props: {
    allState: {
      type: Array,
      default: null
    }
  },
  data() {
    return {
      value: ''
    }
  },
  methods: {
    write() {
      this.$emit('onWrite',this.value);
    },
    clearWrite(){
      this.$emit('clearWrite');
    }
  }
}
</script>
